DROP TABLE IF EXISTS jms_ods.yl_tmsnew_tms_road_section;
CREATE EXTERNAL TABLE jms_ods.yl_tmsnew_tms_road_section(
 ID bigint comment "主键",  --NUMBER(11)
 CODE string comment "线路编码",  --NVARCHAR2(20)
 NAME string comment "路段名称",  --NVARCHAR2(30)
 START_ID bigint comment "始发网点编号",  --NUMBER(11)
 START_CODE string comment "始发网点编号",  --NVARCHAR2(50)
 START_NAME string comment "始发网点名称",  --NVARCHAR2(50)
 END_ID bigint comment "目的网点编号",  --NUMBER(11)
 END_CODE string comment "目的网点编号",  --NVARCHAR2(50)
 END_NAME string comment "目的网点名称",  --NVARCHAR2(50)
 IS_ENABLE smallint comment "是否启用:1启用,0不启用",  --NUMBER(4)
 SPEED double comment "规划时速(KM/H)",  --NUMBER
 MILEAGE double comment "规划里程(KM)",  --NUMBER
 USETIME bigint comment "规划运输用时(MIN)",  --NUMBER(11)
 TOTAL_MILEAGE double comment "总里程(KM)",  --NUMBER
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人姓名",  --NVARCHAR2(20)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_BY bigint comment "更新人ID",  --NUMBER(11)
 UPDATE_BY_NAME string comment "更新人姓名",  --NVARCHAR2(20)
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 DELIVERY_NETWORKLIST string comment "配载网点",  --NCLOB
 DELIVERY_RESERVE_NETWORKLIST string comment "备用配载网点",  --NCLOB
 TRANS_CODE string comment "主用配载全选的父节点",  --NCLOB
 SHOW_CODE string comment "主用配载网点显示",  --NCLOB
 TRANS_RESERVE_CODE string comment "备用配载全选的父节点",  --NCLOB
 SHOW_RESERVE_CODE string comment "备用配载网点显示"  --NCLOB
 )
 COMMENT '路段'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_tmsnew_tms_road_section'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_tmsnew_tms_road_section;